import request from '@/utils/request'

// 查询触发条件列表
export function listTrigger(query) {
  return request({
    url: '/goal/trigger/list',
    method: 'get',
    params: query
  })
}

// 查询触发条件详细
export function getTrigger(id) {
  return request({
    url: '/goal/trigger/' + id,
    method: 'get'
  })
}

export function getTriggerByValue(type) {
  return request({
    url: '/goal/trigger/value/' + type,
    method: 'get'
  })
}


// 新增触发条件
export function addTrigger(data) {
  return request({
    url: '/goal/trigger',
    method: 'post',
    data: data
  })
}

// 修改触发条件
export function updateTrigger(data) {
  return request({
    url: '/goal/trigger',
    method: 'put',
    data: data
  })
}

// 删除触发条件
export function delTrigger(id) {
  return request({
    url: '/goal/trigger/' + id,
    method: 'delete'
  })
}
